﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ecopsy.DataTier;
using SqlLibrary;
using Ecopsy.DataTier.SqlLibrary;


namespace AgencyEntityLib.BaseEntity
{

    public class ClientList : SqlStatmentPropertyOf_PagingList
    {
        public class sqlLoadStatment : ListLoadStatment
        {
            public override string vPropertyOf_ViewName
            {
                get
                {
                    return "v_srch_PropertyOfClient";
                }
            }

            public override string Source_ViewName
            {
                get
                {
                    return "v_client";
                }
            }

            //protected override string GetPropertyOfSql()
            //{

            //    string where = BuildStatment();
            //    string TypeFiltr = (CtegoriaID.Length == 0 ? "" : " PARAM='1BEAA476-1462-48C0-8000-72AEE2F99592' AND VALUE='" + CtegoriaID + "'");


            //    if (where.Length == 0) return " select Id into #SelectList  from  " + Source_ViewName + (TypeFiltr.Length == 0 ? " " :
            //        " where  id in (select id from " + vPropertyOf_ViewName + " where" + TypeFiltr + ") ");

            //    string sql = " select Id into #SelectList  from" +
            //      "(" +
            //      "select " +
            //          vPropertyOf_ViewName + ".ID as ID," +
            //          "1 as ItemCount " +
            //      "from " +
            //          vPropertyOf_ViewName +
            //      " where 	" +
            //       where + (CtegoriaID.Length == 0 ? "" : " OR ") + TypeFiltr +
            //          ") as res   " +
            //          "group by res.ID,ItemCount " +
            //          "having sum(ItemCount)= " + ((CtegoriaID.Length == 0 ? 0 : 1) + this.ChildNodes.Count).ToString();

            //    return sql;
            //}

            //private string _CtegoriaID = string.Empty;
            //public string CtegoriaID
            //{
            //    get { return _CtegoriaID; }
            //    set { _CtegoriaID = value; }
            //}

        }

    }

   
}

